// Access to XMLHttpRequest at '' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
module.exports = {
  devServer: {
    // port: 8080,
    // host: 'localhost',
    // open: true,
    // hot: true,
    // 代理跨域
    proxy: {
      '/passport': {
        target: 'https://passport.bilibili.com',
        // ws: true,
        secure: false,
        changeOrigin: true,
        pathRewrite: { '^/passport': '' }
      },
      '/api': {
        target: 'https://api.bilibili.com',
        secure: false,
        // ws: true,
        changeOrigin: true,
        pathRewrite: { '^/api': '' },
        headers: {
          referer: 'https://space.bilibili.com/31100478/fans/follow',
          origin: 'https://space.bilibili.com'
        }
      }
    }
  }
}
